<!--套票标签列表页-->
<template>
    <div style="height: 100%;">
        <m-page-list
                :option="option"
                :page="page"
                :total="total"
                :table-data="tableData"
                :table-loading="tableLoading"
                v-model:value="query"
                @h-btn-click="hBtnClick"
                @col-btn-click="colBtnClick"
                @search-data="searchData"
        />
        <m-dialog-form ref="dialogRef" :data="dialogData" v-model:show="dialogShow" :option="dialogOption" @confirm="dialogConfirm" ></m-dialog-form>
    </div>
</template>

<script setup>

  import {ref,reactive,onMounted,nextTick} from 'vue'
  //组件
  import MPageList from '@/components/PageList'
  import MDialogForm from '@/components/DialogForm/DialogForm'
  //请求
  import {getTicketPackageLabel, addTicketPackageLabel, editTicketPackageLabel, delTicketPackageLabel} from '@/request/api/basicData'

  import {usePageList} from "../../composables/pageList";

  let opts = {
    auth_id: 'ticketPackageLabel',
    getApi: getTicketPackageLabel,addApi:addTicketPackageLabel,editApi:editTicketPackageLabel,delApi:delTicketPackageLabel,
    idKey: 'packag_label_id'
  };
  let {option,page,total,tableLoading,tableData,query,dialogRef,dialogShow,dialogData,dialogOption,
    hBtnClick,colBtnClick,searchData,getDataList,dialogConfirm} = usePageList(opts);

  option.conditions = [
    {label: '套票标签编号',type: 'text',field_id: 'id',col: 12},
    {label: '套票类型名称',type: 'text',field_id: 'name',col: 12},
  ];
  option.cols = [
    {prop: 'packag_label_id', label: '套票标签编号',},
    {prop: 'packag_label_name', label: '套票标签名称',},
    {prop: 'is_used',label: '使用标识',type: 'bool' },
    {prop: 'sort',label: '序号' },
    {prop: 'input_id',label: '录入员号' },
    {prop: 'input_name',label: '录入员名' },
    {prop: 'input_time',label: '录入时间' },
    {prop: 'modify_id',label: '修改员号' },
    {prop: 'modify_name',label: '修改员名' },
    {prop: 'modify_time',label: '修改时间' },
  ];
  dialogOption.fieldList = [
    {field_id: 'id',show_field: 'packag_label_id',label: '套票标签编号',type: 'text',col: 3 ,editDisabled: true,required: true},
    {field_id: 'name',show_field: 'packag_label_name',label: '套票标签名称',type: 'text',col: 3 ,required: true },
    {field_id: 'sort',label: '序号',type: 'number',col: 3 ,required: true },
    {field_id: 'isUsed',show_field: 'is_used',label: '使用标识',type: 'bool',col: 3  },
  ];

</script>

<style scoped>

</style>
